import GlobalStore from '../global.store';
import fetch from '../common/fetch';
import api from './api';
import {observable, computed, reaction, action, runInAction, useStrict} from 'mobx';
import {getCookie} from '../common/cookies';
useStrict(true);``

export default class HomeStore extends GlobalStore{
  constructor(props) {
    super(props);
  }
  @observable loading = false;
  @observable projects = '';
  @observable projectName = '';
  @observable token = '';
  timer = '';

  @action init = () => {
    // 如果不存在token，就是处于未登录状态
    this.token = getCookie('token');
    if(!this.token) return false;

    this.projects = getCookie('projects');
    this.projectName = getCookie('projectName');
    return true;
  }
}
